package com.kai.mpc_plugin;

import com.sun.jna.Library;
import com.sun.jna.Native;

public interface MPCNative extends Library {
    public static final MPCNative mpcInstance = Native.loadLibrary("_kai_mpc", MPCNative.class);

    long getVersion();

    /**
     * 生成MPC分片，共三片
     *
     * @param salt
     * @param path
     * @return
     */
    String forgingMPCJava(String salt, String path);

    String useMnemonicForgingMPCJava(String mne, String salt, String path);

    void freeForgingMPC(String ptr);

    long verifyMPCFragment(String frag);

//    版本 2 中 弃掉
    String mpcFragmentGetPublicKey(String frag);

    String recoverMPCFragment(String frag1, String frag2);

    String mpcEscapeJava(String frag1, String frag2, String salt);

    String signTx(String tx, String mpcA, String mpcB, String salt);

    int getVersionFromFrag(String frag);

    String getAddress(String frag,String chainId);

    String upgradeMPC(String frag1,String frag2,String salt);

    String solSignTx(String tx, String mpcA, String mpcB, String salt);

}
